package com.wolfpire.workflow.spring.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.wolfpire.system.common.Constants;
import com.wolfpire.system.common.EasyuiPage;
import com.wolfpire.system.common.Page;
import com.wolfpire.system.common.base.dao.IBaseHibernateDao;
import com.wolfpire.system.common.base.service.impl.BaseHibernateService;
import com.wolfpire.workflow.dao.FormsDao;
import com.wolfpire.workflow.om.Forms;
import com.wolfpire.workflow.spring.FormsService;

@Service("formsService")
public class FormsServiceImpl extends BaseHibernateService<Forms, Long> implements FormsService {
	
	@Resource private FormsDao formsDao;

	@Override
	public List<Forms> list(Forms forms) {
		return this.formsDao.list(forms);
	}

	@Override
	protected IBaseHibernateDao<Forms, Long> getEntityDao() {
		return this.formsDao;
	}

	@Override
	public Page<Forms> setPageDataList(EasyuiPage<Forms> page, Forms filterForms) {
		return this.formsDao.findFormses(page, filterForms);
	}

	@Override
	public void delete(Long id) {
		Forms forms = this.formsDao.get(id);
		if (null != forms) {
			forms.setStatus(Constants.DELETE_FLAG.toString());
			this.formsDao.saveOrUpdate(forms);
		}
	}

}
